
package Controllers;

import DAO.SignUp_Dao;

public class SignUp_Validator {

    public SignUp_Validator(SignUp_Dao signUp_Dao) {
    }

    public SignUp_Validator() {
        
    }

    public boolean validateSignUp(String Name, String LastName, String Phone, String Email, String Username, String Password, String Repass) {
        boolean x = true;
        if (Name.isEmpty() || LastName.isEmpty() || Phone.isEmpty() || Email.isEmpty() || Username.isEmpty() || Password.isEmpty() || Repass.isEmpty()) {
            x = false;
        } else if (!Email.contains("@") || !Email.contains(".") || Email.startsWith("@")) {
            x = false;
        } else if (Phone.matches("[0-9]+") == false) {
            x = false;
        } else if (Phone.length() > 10 || Phone.length() < 10) {
            x = false;
        } else if (!Password.equals(Repass)) {
            x = false;
        }
        return x;
    }
}
